from django.conf.urls.defaults import *

from transcodercaches.models import PreCacheRule
from assets.resource import Resource
from assets.views import SerializeRule
from django.contrib.auth.decorators import user_passes_test

urlpatterns += patterns('transcodercaches.views',   
  (r'^damn/precacherules/', Resource(PreCacheRule, 'name', exclude_read=['srcFormats', 'arguments'], serializer=SerializeRule, decorator=user_passes_test(lambda u: u.is_superuser))),
  (r'^damn/precacherules/(?P<name>[^/]+?)/srcFormats/?$', 'precacherule_formats'),
  (r'^damn/precacherules/(?P<name>[^/]+?)/arguments/?$', 'precacherule_arguments'),
)

